package com.ljy.tkmodel.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.ljy.tkmodel.entity.Course;
import com.ljy.tkmodel.mapper.CourseMapper;
import com.ljy.tkmodel.service.CourseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements CourseService {

    @Override
    public int insertCourse(Course course) {
        if (course!=null){
            return  baseMapper.insert(course);
        }
        return 0;
    }

    @Override
    public List<Course> selectCourse(Map map) {
        if (CollectionUtil.isEmpty(map)){
            return baseMapper.selectList(null);
        }else {
            //todo 查询课程
            return null;
        }
    }
}
